﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;



namespace BPM.RepotrService
{
    [Serializable()]
    [System.ServiceModel.ServiceBehavior(InstanceContextMode = System.ServiceModel.InstanceContextMode.Single)]
    public class RpService : BPM.RepotrService.IRpService 
    {

        BPM.Foundation.WFDB.WFDBDataContext dbwf;
        BPM.Foundation.PWDB.PWDBDataContext dbpw;
        public RpService(BPM.Foundation.WFDB.WFDBDataContext WFDB,BPM.Foundation.PWDB.PWDBDataContext PWDB)
        {
            dbwf = WFDB;
            dbpw = PWDB;
        }


        public List<BPM.Foundation.PWDB.PW_Department> PW_Department(int m, int n)
        {

            if (m == 0 && n == 0)
            {
                return dbpw.PW_Department.ToList();
            }
            else
            {
                return dbpw.PW_Department.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.PWDB.PW_DepartmentDutyUserRelation> PW_DepartmentDutyUserRelation(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_DepartmentDutyUserRelation.ToList();
            }
            else
            {
            return dbpw.PW_DepartmentDutyUserRelation.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.PWDB.PW_DepartmentExpansionInfo> PW_DepartmentExpansionInfo(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_DepartmentExpansionInfo.ToList();
            }
            else
            {
            return dbpw.PW_DepartmentExpansionInfo.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.PWDB.PW_DepartmentRelation> PW_DepartmentRelation(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_DepartmentRelation.ToList();
            }
            else
            {
            return dbpw.PW_DepartmentRelation.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.PWDB.PW_Duty> PW_Duty(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_Duty.ToList();
            }
            else
            {
            return dbpw.PW_Duty.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.PWDB.PW_DutyExpansionInfo> PW_DutyExpansionInfo(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_DutyExpansionInfo.ToList();
            }
            else
            {
            return dbpw.PW_DutyExpansionInfo.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.PWDB.PW_DutyInDepartment> PW_DutyInDepartment(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_DutyInDepartment.ToList();
            }
            else
            {
            return dbpw.PW_DutyInDepartment.Skip(m).Take(n).ToList();
            }
        }


  


        public List<BPM.Foundation.PWDB.PW_ExpansionTableTemplate> PW_ExpansionTableTemplate(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_ExpansionTableTemplate.ToList();
            }
            else
            {
            return dbpw.PW_ExpansionTableTemplate.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.PWDB.PW_ExpansionTableTemplateItem> PW_ExpansionTableTemplateItem(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_ExpansionTableTemplateItem.ToList();
            }
            else
            {
            return dbpw.PW_ExpansionTableTemplateItem.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.PWDB.PW_Mode> PW_Mode(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_Mode.ToList();
            }
            else
            {
            return dbpw.PW_Mode.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.PWDB.PW_ModePower> PW_ModePower(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_ModePower.ToList();
            }
            else
            {
            return dbpw.PW_ModePower.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.PWDB.PW_User> PW_User(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_User.ToList();
            }
            else
            {
            return dbpw.PW_User.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.PWDB.PW_UserExpansionInfo> PW_UserExpansionInfo(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_UserExpansionInfo.ToList();
            }
            else
            {
            return dbpw.PW_UserExpansionInfo.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.PWDB.PW_DepartmentDutyUserRelation_V> PW_DepartmentDutyUserRelation_V(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_DepartmentDutyUserRelation_V.ToList();
            }
            else
            {
            return dbpw.PW_DepartmentDutyUserRelation_V.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.PWDB.PW_DepartmentDutyUserRelation_VCN> PW_DepartmentDutyUserRelation_VCN(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_DepartmentDutyUserRelation_VCN.ToList();
            }
            else
            {
            return dbpw.PW_DepartmentDutyUserRelation_VCN.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.PWDB.PW_DutyInDepartment_V> PW_DutyInDepartment_V(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_DutyInDepartment_V.ToList();
            }
            else
            {
            return dbpw.PW_DutyInDepartment_V.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.PWDB.PW_DutyInDepartment_VCN> PW_DutyInDepartment_VCN(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbpw.PW_DutyInDepartment_VCN.ToList();
            }
            else
            {
            return dbpw.PW_DutyInDepartment_VCN.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.WF_Business> WF_Business(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.WF_Business.ToList();
            }
            else
            {
            return dbwf.WF_Business.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.WF_ChildRegress> WF_ChildRegress(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.WF_ChildRegress.ToList();
            }
            else
            {
            return dbwf.WF_ChildRegress.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.WF_Instance> WF_Instance(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.WF_Instance.ToList();
            }
            else
            {
            return dbwf.WF_Instance.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.WF_InstanceState> WF_InstanceState(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.WF_InstanceState.ToList();
            }
            else
            {
            return dbwf.WF_InstanceState.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.WF_Message> WF_Message(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.WF_Message.ToList();
            }
            else
            {
            return dbwf.WF_Message.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.WF_StartWorkflowPower> WF_StartWorkflowPower(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.WF_StartWorkflowPower.ToList();
            }
            else
            {
            return dbwf.WF_StartWorkflowPower.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.WF_Template> WF_Template(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.WF_Template.ToList();
            }
            else
            {
            return dbwf.WF_Template.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.WF_TemplateInfo> WF_TemplateInfo(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.WF_TemplateInfo.ToList();
            }
            else
            {
            return dbwf.WF_TemplateInfo.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.WF_TemplateRule> WF_TemplateRule(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.WF_TemplateRule.ToList();
            }
            else
            {
            return dbwf.WF_TemplateRule.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.WF_TemplateStateInfo> WF_TemplateStateInfo(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.WF_TemplateStateInfo.ToList();
            }
            else
            {
            return dbwf.WF_TemplateStateInfo.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.FM_Form_V> FM_Form_V(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.FM_Form_V.ToList();
            }
            else
            {
            return dbwf.FM_Form_V.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.FM_Item_V> FM_Item_V(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.FM_Item_V.ToList();
            }
            else
            {
            return dbwf.FM_Item_V.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.WF_Instance_V> WF_Instance_V(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.WF_Instance_V.ToList();
            }
            else
            {
            return dbwf.WF_Instance_V.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.WF_InstanceState_V> WF_InstanceState_V(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.WF_InstanceState_V.ToList();
            }
            else
            {
            return dbwf.WF_InstanceState_V.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.WF_Message_V> WF_Message_V(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.WF_Message_V.ToList();
            }
            else
            {
            return dbwf.WF_Message_V.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.WF_StartWorkflowPower_V> WF_StartWorkflowPower_V(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.WF_StartWorkflowPower_V.ToList();
            }
            else
            {
            return dbwf.WF_StartWorkflowPower_V.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.WF_Template_V> WF_Template_V(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.WF_Template_V.ToList();
            }
            else
            {
            return dbwf.WF_Template_V.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.FM_Form> FM_Form(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.FM_Form.ToList();
            }
            else
            {
            return dbwf.FM_Form.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.FM_Item> FM_Item(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.FM_Item.ToList();
            }
            else
            {
            return dbwf.FM_Item.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.FM_Templet> FM_Templet(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.FM_Templet.ToList();
            }
            else
            {
            return dbwf.FM_Templet.Skip(m).Take(n).ToList();
            }
        }


        public List<BPM.Foundation.WFDB.FM_TempletItem> FM_TempletItem(int m, int n)
        {
                        if (m == 0 && n == 0)
            {
                return dbwf.FM_TempletItem.ToList();
            }
            else
            {
                return dbwf.FM_TempletItem.Skip(m).Take(n).ToList();
            }
        }






    }
}
